<?php

namespace App\Http\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Redis;


class SharePropLog extends Base
{
    protected $table = 'send_prop_log';

    public function __construct(array $attributes = [])
    {
        parent::__construct($this->table, $attributes);
    }

    public function createSendGoodsLog($data)
    {
        $res = DB::table($this->table)->insertGetId($data);
        if (!$res)
            return false;
        return $res;
    }

    /*
         * 赠送记录
         * @param [$user_id]   用户id
         * @param [$send_type]   赠送类型
         * */
    public function sendUserLog($user_id)
    {
        return DB::table($this->table)
            ->where(['user_id' => $user_id])
            ->get();
    }
}